% Reference:
% Constrained Trajectory Optimization for Planetary Entry via Sequential Convex Programming

clc
clear 
close all;
getparams();
for s = 1:s-1
    % 替换剖面 由上一步的结果计算系数
    CL = -0.21 + 0.005059*Ma(j) + 0.0497*alpha(j) + 0.0004244*alpha(j)^2;
    CD = 0.05244 + 0.00209*Ma(j) - 0.01629*alpha(j) + 0.001937*alpha(j)^2;
    rho = rho0*exp(-(r(j)-R0)/hs);
    L = rho*V(j)^2*Vc^2*S*CL/(2*mass*g0);
    D = rho*V(j)^2*Vc^2*S*CD/(2*mass*g0);
    % 定义变量
    R = sdpvar(1,N+1);  
    Vv = sdpvar(1,N+1);
    Fpa = sdpvar(1,N+1);
    Azi = sdpvar(1,N+1);
    Phi = sdpvar(1,N+1);
    
    % 定义约束
    F = F + [ ];
    % SOCP 子问题求解
    solvesdp(F, obj, ops);
end
